<?php
namespace app\index\controller;

use think\View;
use think\Db;
use think\Session;
use think\Controller;

class Index extends Controller
{   
	//首页数据
    public function index()
    {   
        //return  $this->fetch('index');

        $partner_secret = '3ff5e8c359444878a29bae2c24e9dcc6';

        $array['method']      = 'get_status_bycode';
        $array['sign_type']   = 'MD5';
        $array['partner_id']  = 'hfaxp16614d595d9';
        $array['timestamp']   =  time();
        $array['version']     = '1.0.0';
        $array['biz_content'] = "{\"ticcod\":\"ZPMT17KRWL\"}";
        $array1 = $array;
        sort($array);
        $string = implode($array);
        $array['sign']  = md5($partner_secret.$string.$partner_secret);
        $array1['sign'] = $array['sign'];
        
        //$array1['biz_content']['ticcod'] = 'ZPMT17KRWL';

        
    //     $data =   '{
    //   "method": "get_status_bycode",
    //   "sign": "F81B05580606FEAEA44F5FEEE93E4192",
    //   "sign_type": "MD5",
    //   "partner_id":"hfaxp16614d595d9",
    //   "timestamp": "20170531144937",
    //   "version": "1.0.0"
    // }';
        
        //$headers = array("Content-Type: text/json");
        //$result  = httpRequest('https://qa8-a.hfax.com/open-api/gateway','post',$array1);
        //$result  = sf_api_http_request('https://qa8-a.hfax.com/open-api/gateway',$data);
        $result  = posturl('http://qa8-a.hfax.com/open-api/gateway',$array1);
    }

    

    //用户抽奖记录
    public function prize_list(){
    }

    //抽奖奖品结果
    public function drawPriceResult(){
    	
	}

    //抽奖概率值获取中奖商品的id
	public function get_rand($proArr) { 
	
	} 

}
